<?php

namespace App\Http\Controllers\Test;

use App\Ext\Wechat\Common;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class WechatController extends Controller
{
    private $appID;
    private $appSecret;
    private $accessToken;

    public function __construct()
    {
        $this->appID = config('wechat.appID');
        $this->appSecret = config('wechat.appSecret');
    }

    public function accessToken()
    {
        $this->accessToken = Common::accessToken($this->appID, $this->appSecret);
        dump($this->accessToken);
    }

    public function server()
    {
        $this->accessToken();
        $server = Common::server($this->accessToken->access_token);
        dump($server);
    }
}
